package com.leetcode.LC;

import java.util.ArrayList;
import java.util.List;

public class LC412 {
    public List<String> fizzBuzz(int n) {
        ArrayList<String> list = new ArrayList<>();
        for (int i = 1; i <= n; i++) {
            if (i % 3 != 0 && i % 5 != 0) {
                list.add(i + "");
            } else if (i % 3 == 0 && i % 5 == 0) {
                list.add("FizzBuzz");
            } else if (i % 3 == 0) {
                list.add("Fizz");
            } else if (i % 5 == 0) {
                list.add("Buzz");
            }
        }

        return list;
    }

    public static void main(String[] args) {
        for (String fizzBuzz : new LC412().fizzBuzz(15)) {
            System.out.print(fizzBuzz + ",");
        }
    }
}
